package com.hxzy.shop.common.dto.merchant;

import com.hxzy.shop.common.dto.merchant.req.AnnouncementReq;
import com.hxzy.shop.common.dto.merchant.resp.AnnouncementDetailResp;
import com.hxzy.shop.entity.Announcement;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 功能描述
 *
 * @author tonneyyy
 */
@Mapper
public interface AnnouncementConvert {

    AnnouncementConvert INSTANCE = Mappers.getMapper(AnnouncementConvert.class);

    AnnouncementDetailResp convert(Announcement announcement);

    @Mapping(target = "isDel",ignore = true)
    @Mapping(target = "createTime",ignore = true)
    Announcement convert(AnnouncementReq req);
    AnnouncementDetailResp toAnnouncementDetailResp(Announcement announcement);
}
